using UnityEngine;
using UnityEngine.UIElements;

namespace DA.AnimGraph.Editor {
    internal class AGEStyle {
        public readonly StyleSheet CommonStyles;
        public readonly StyleSheet Grid;

        public AGEStyle() {
            CommonStyles = Resources.Load<StyleSheet>("CommonStyles");
            Grid = Resources.Load<StyleSheet>("GridUSS");
        }

        // SetStyle
        public void SS_GraphView(VisualElement elem) {
            elem.styleSheets.Add(Grid);
        }

        public void SS_PaneTitle(VisualElement elem) {
            elem.styleSheets.Add(CommonStyles);
            elem.AddToClassList("pane-title");
            elem.AddToClassList("border-light");
        }

        public void SS_Pane(VisualElement elem) {
            elem.styleSheets.Add(CommonStyles);
            elem.AddToClassList("color-bg-unity-pane");
        }

        public void SS_MenuBar(VisualElement elem, AGEMode mode) {
            elem.styleSheets.Add(CommonStyles);
            elem.ClearClassList();
            switch (mode) {
                case AGEMode.Preview:
                    elem.AddToClassList("color-bg-preview");
                    break;
                default:
                    elem.AddToClassList("color-bg-unity-title");
                    break;
            }
        }

        public void SS_InspectorField(VisualElement elem) {
            elem.styleSheets.Add(CommonStyles);
            elem.AddToClassList("inspector-field");
        }

        public void SS_Breadcrumb(VisualElement elem) {
            elem.styleSheets.Add(CommonStyles);
            elem.AddToClassList("breadcrumb");
        }
    }

}
